<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Following Tutorial</title>
</head>
<body>
	<h1>Enter in your available times</h1>
	<f:view>
		<h:messages layout="table"></h:messages>

		<h:form>
			<h:commandLink binding="#{pleaseWork.addCommand }" accesskey="n"
				action="#{pleaseWork.addNew }" value="Add new Time"></h:commandLink>
		</h:form>

		<h:form binding="#{pleaseWork.form }" rendered="false">
			<h:panelGrid columns="3">
				Start Time
				<h:selectOneMenu id="selectStartHr" value="#{pleaseWork.currentStartHour}">
					<f:selectItems id="startHrs" value="#{pleaseWork.hourList}" />
				</h:selectOneMenu>
				<h:selectOneMenu id="selectStartMin" value="#{pleaseWork.currentStartMin}">
					<f:selectItems id="startMins" value="#{pleaseWork.minList}" />
				</h:selectOneMenu>
			</h:panelGrid>
			<h:panelGrid columns="3">
				End Time
				<h:selectOneMenu id="selectEndHr" value="#{pleaseWork.currentEndHour}">
					<f:selectItems id="endHrs" value="#{pleaseWork.hourList}" />
				</h:selectOneMenu>
				<h:selectOneMenu id="selectEndMin" value="#{pleaseWork.currentEndMin}">
					<f:selectItems id="endMins" value="#{pleaseWork.minList}" />
				</h:selectOneMenu>
			</h:panelGrid>
			<h:panelGrid columns="3">
				Day
				<h:selectOneMenu id="selectDay" value="#{pleaseWork.currentDay }">
					<f:selectItems id="days" value="#{pleaseWork.daysOfWeek }"></f:selectItems>
				</h:selectOneMenu>
			</h:panelGrid>
			<h:panelGroup>
				<h:commandButton action="#{pleaseWork.save }" value="Save"
					accesskey="s"></h:commandButton>
				<h:commandButton action="#{pleaseWork.cancel }" value="Cancel"
					accesskey="c" immediate="true"></h:commandButton>
				<h:commandButton action="#{pleaseWork.submit }" value="Submit Times" 
					accesskey="b" immediate="true">
				</h:commandButton>
			</h:panelGroup>

		</h:form>
		<h:form>
			<h:panelGrid columns="2">
				<h:commandLink id="hide" actionListener="#{pleaseWork.displayTable}"
					value="Hide Table">
				</h:commandLink>
				<h:commandLink id="show" actionListener="#{pleaseWork.displayTable}"
					value="Show Table">
				</h:commandLink>
			</h:panelGrid>
		</h:form>
		
		
<%-- 		<h:form binding="#{pleaseWork.tableForm}"> --%>
<!-- 			Here we start the data table -->

<%-- 			<h:dataTable value="#{pleaseWork.todos}" var="todo" --%>
<!-- 				styleClass="todo" headerClass="todoheader" -->
<!-- 				columnClasses="first, rest"> -->
<%-- 				<h:column> --%>
<!-- 					Via this facet we define the table header (column 1) -->
<%-- 					<f:facet name="header"> --%>
<%-- 						<h:column> --%>
<%-- 							<h:outputText value="Prio"></h:outputText> --%>
<%-- 						</h:column> --%>
<%-- 					</f:facet> --%>
<%-- 					<h:outputText value="#{todo.priority}"></h:outputText> --%>
<%-- 				</h:column> --%>
<%-- 				<h:column> --%>
<!-- 					Via this facet we define the table header (column 2) -->
<%-- 					<f:facet name="header"> --%>
<%-- 						<h:column> --%>
<%-- 							<h:outputText value="Title"></h:outputText> --%>
<%-- 						</h:column> --%>
<%-- 					</f:facet> --%>
<%-- 					<h:outputText value="#{todo.title}"></h:outputText> --%>

<%-- 				</h:column> --%>

<%-- 				<h:column> --%>
<!-- 					Via this facet we define the table header (column 3) -->
<%-- 					<f:facet name="header"> --%>
<%-- 						<h:column> --%>
<%-- 							<h:outputText value="Description"></h:outputText> --%>
<%-- 						</h:column> --%>
<%-- 					</f:facet> --%>
<%-- 					<h:outputText value="#{todo.description}"></h:outputText> --%>
<%-- 				</h:column> --%>

<%-- 				<h:column> --%>
<!-- 					Via this facet we define the table header (column 4) -->
<%-- 					<f:facet name="header"> --%>
<%-- 						<h:column> --%>
<%-- 							<h:outputText value="Actions"></h:outputText> --%>
<%-- 						</h:column> --%>
<%-- 					</f:facet> --%>
<%-- 					<h:panelGrid columns="2"> --%>
<%-- 						<h:commandLink value="delete" action="#{pleaseWork.delete}"> --%>
<%-- 							<f:setPropertyActionListener target="#{pleaseWork.todo}" --%>
<%-- 								value="#{todo}" /> --%>
<%-- 						</h:commandLink> --%>
<%-- 					</h:panelGrid> --%>
<%-- 				</h:column> --%>
<%-- 			</h:dataTable> --%>

<%-- 		</h:form> --%>

		<%-- 		<h:form id="main"> --%>
		<%-- 			<h:selectOneMenu id="selectHr1" value="#{pleaseWork.currentHour}"> --%>
		<%-- 				<f:selectItems id="itemHours1" value="#{pleaseWork.hourList}" /> --%>
		<%-- 			</h:selectOneMenu> --%>
		<%-- 			<h:selectOneMenu id="selectMin1" value=""> --%>
		<%-- 				<f:selectItems id="itemMinutes1" value="#{pleaseWork.minList}" /> --%>
		<%-- 			</h:selectOneMenu> --%>
		<%-- 			<h:selectOneMenu id="selectTime2" value="#{pleaseWork.currentHour}"> --%>
		<%-- 				<f:selectItems id="itemHours2" value="#{pleaseWork.hourList}" /> --%>
		<%-- 			</h:selectOneMenu> --%>
		<%-- 			<h:selectOneMenu id="selectMin2" value=""> --%>
		<%-- 				<f:selectItems id="itemMinutes2" value="#{pleaseWork.minList}" /> --%>
		<%-- 			</h:selectOneMenu><br /> --%>

		<%-- 			<h:commandButton value="Set Time" action ="#{pleaseWork.setTime}" ></h:commandButton> --%>

		<%-- 		</h:form> --%>
	</f:view>

</body>
</html>